//
//  ShopCell.m
//  MyNewBase
//
//  Created by 胡超 on 16/3/9.
//  Copyright © 2016年 lbanma. All rights reserved.
//

#import "ShopCell.h"

@implementation ShopCell

-(UIImageView *)headView{
    if (!_headView) {
        _headView = [UIImageView new];
        _headView.contentMode = 2;
        _headView.clipsToBounds = YES;
        [self.contentView addSubview:_headView];
        [_headView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.left.mas_equalTo(10);
            make.bottom.mas_equalTo(-10);
            make.size.mas_equalTo(CGSizeMake(80, 60));
        }];
    }
    return _headView;
}

-(UILabel *)titleLable{
    if (!_titleLable) {
        _titleLable = [UILabel new];
        _titleLable.numberOfLines = 1;
        _titleLable.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:_titleLable];
        [_titleLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(15);
            make.left.mas_equalTo(self.headView.mas_right).mas_equalTo(10);
            
        }];
    }
    return _titleLable;
}

-(UIImageView *)scoreView{
    if (!_scoreView) {
        _scoreView = [UIImageView new];
        [self.contentView addSubview:_scoreView];
        [_scoreView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leftMargin.mas_equalTo(self.titleLable.mas_leftMargin);
            make.centerY.mas_equalTo(self.headView.mas_centerY);
            make.size.mas_equalTo(CGSizeMake(15*5, 15));
        }];
    }
    return _scoreView;
}

-(UILabel *)areaLable{
    if (!_areaLable) {
        _areaLable = [UILabel new];
        _areaLable.numberOfLines = 1;
        _areaLable.textColor = [UIColor grayColor];
        _areaLable.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_areaLable];
        [_areaLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leftMargin.mas_equalTo(self.titleLable.mas_leftMargin);
            make.bottom.mas_equalTo(-15);
        }];
    }
    return _areaLable;
}

-(UILabel *)distanceLable{
    if (!_distanceLable) {
        _distanceLable = [UILabel new];
        _distanceLable.numberOfLines = 1;
        _distanceLable.textColor = [UIColor grayColor];
        _distanceLable.font = [UIFont systemFontOfSize:12];
        [self.contentView addSubview:_distanceLable];
        [_distanceLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottomMargin.mas_equalTo(self.areaLable.mas_bottomMargin);
            make.right.mas_equalTo(-10);
        }];
    }
    return _distanceLable;
}


-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.contentView.hidden = NO;
    }
    return self;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
